<template>
  <div class="u-crumbs">
    <el-breadcrumb separator="/">
      <template v-for='(v, i) in (ifCreateCrumbs ? data : list)'>
        <el-breadcrumb-item v-if='v.name' :to="{ name: v.name, query: v.query || {} }">{{ v.title }}</el-breadcrumb-item>
        <el-breadcrumb-item v-else>{{ v.title }}</el-breadcrumb-item>
      </template>
    </el-breadcrumb>
  </div>
</template>

<script>
export default {

  name: 'uCrumbs',

  props: {
    ifCreateCrumbs: {
      type: Boolean,
      default: false
    },
    list: {
      type: Array,
      default: []
    }
  },

  data() {
    return {
      data: []
    }
  },
  created() {
    if (this.ifCreateCrumbs) {
      this.createCrumbs()
    }
  },
  methods: {
    createCrumbs() {}
  }
}
</script>

<style lang="less">
.u-crumbs {
  padding: 8px 15px;
  .el-breadcrumb__inner {
    color: @t-primary;
    font-weight: normal;
  }
  span {
    font-size: 14px;
  }
}
</style>

